package com.fmc123.base.modules.entity ;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.fmc123.base.pesistence.BaseEntity;

/**
* @ClassName: SysRole
* @Description: 角色Entity 
* @author fmc
* @date 2015年11月14日下午3:21:27
*
 */
@Entity
@Table(name = "sys_role" )
public class SysRole extends BaseEntity {

    private static final long serialVersionUID = 1L;
    /**
     * 角色编码
     */
    @Column(name = "CODE" ,length = 50 ,nullable = false)  
    private String code ;
    
    /**
     * 角色名称
     */
    @Column(name = "NAME" ,length = 100 ,nullable = false)  
    private String name ;
    
    /**
     * 角色描述
     */
    @Column(name = "DESCRIPTION" ,length = 255)  
    private String description ;
    
    /**
     * 状态
     */
    @Column(name = "STATE" ,length = 5)  
    private Integer state ;
    
    /**
     * 用户角色
     */
    @OneToMany(fetch=FetchType.LAZY,mappedBy="role",targetEntity=SysUserRole.class)
    private Set<SysUserRole> userRoles = new HashSet<SysUserRole>();

    public String getCode() {
      return code;
    }

    public void setCode(String code) {
      this.code = code;
    }

    public String getName() {
      return name;
    }

    public void setName(String name) {
      this.name = name;
    }

    public String getDescription() {
      return description;
    }

    public void setDescription(String description) {
      this.description = description;
    }

    public Integer getState() {
      return state;
    }

    public void setState(Integer state) {
      this.state = state;
    }

    public Set<SysUserRole> getUserRoles() {
      return userRoles;
    }

    public void setUserRoles(Set<SysUserRole> userRoles) {
      this.userRoles = userRoles;
    }
    
    
     
}